//
//  CellForStatistics.m
//  UESTCPioneer
//
//  Created by sss on 14-8-22.
//  Copyright (c) 2014年 Sway. All rights reserved.
//

#import "CellForStatistics.h"

@implementation CellForStatistics

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        [self.contentView addSubview:self.rankLable];
        [self.contentView addSubview:self.nameLabel];
        [self.contentView addSubview:self.actIndexLable];
        [self.contentView addSubview:self.attentionLable];
    }
    return self;
}

- (void)awakeFromNib
{
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(UILabel*)rankLable{
    if (!_rankLable) {
        _rankLable = [[UILabel alloc] initWithFrame:CGRectMake(15, 0, 15, self.frame.size.height - 8)];
        _rankLable.textColor = [UIColor blackColor];
        _rankLable.textAlignment = NSTextAlignmentLeft;
        _rankLable.font = [UIFont systemFontOfSize:12.0];
        _rankLable.text = @"-";
    }
    return _rankLable;
}
-(UILabel*)nameLabel{
    if (!_nameLabel) {
        _nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(40, 0, 160, self.frame.size.height - 8)];
        _nameLabel.textColor = [UIColor grayColor];
//        _nameLabel.textAlignment = NSTextAlignmentLeft;
         _nameLabel.textAlignment = NSTextAlignmentCenter;
        _nameLabel.font = [UIFont systemFontOfSize:12.0];
        _nameLabel.text = @"-";
        _nameLabel.numberOfLines = 0;
    }
    return _nameLabel;
}
-(UILabel*)actIndexLable{
    if (!_actIndexLable) {
        _actIndexLable = [[UILabel alloc] initWithFrame:CGRectMake(200, 0, 50, self.frame.size.height - 8)];
        _actIndexLable.textColor = [UIColor blackColor];
//        _actIndexLable.textAlignment = NSTextAlignmentLeft;
        _actIndexLable.textAlignment = NSTextAlignmentCenter;
        _actIndexLable.font = [UIFont systemFontOfSize:10.0];
        _actIndexLable.text = @"-";
    }
    return _actIndexLable;
}
-(UILabel*)attentionLable{
    if (!_attentionLable) {
        _attentionLable = [[UILabel alloc] initWithFrame:CGRectMake(250, 0, 50, self.frame.size.height - 8)];
        _attentionLable.textColor = [UIColor blackColor];
//        _attentionLable.textAlignment = NSTextAlignmentLeft;
        _attentionLable.textAlignment = NSTextAlignmentCenter;
        _attentionLable.font = [UIFont systemFontOfSize:10.0];
        _attentionLable.text = @"-";
    }
    return _attentionLable;
}

-(void)setElementFrame{
    _rankLable.frame = CGRectMake(15, 0, 40, self.frame.size.height - 8);
    _nameLabel.frame = CGRectMake(55, 0, 200, self.frame.size.height - 8);
    _actIndexLable.frame = CGRectMake(255, 0, 50, self.frame.size.height - 8);
}

-(void)restoreFrame{
    _rankLable.frame = CGRectMake(15, 0, 15, self.frame.size.height - 8);
    _nameLabel.frame = CGRectMake(40, 0, 160, self.frame.size.height - 8);
    _actIndexLable.frame = CGRectMake(200, 0, 50, self.frame.size.height - 8);
    _attentionLable.frame = CGRectMake(250, 0, 50, self.frame.size.height - 8);
}
@end
